package com.zhuannimei.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.zhuannimei.R;
import com.zhuannimei.domain.ProductHistory;
import com.zhuannimei.utility.JackViewHolder;
import com.zhuannimei.utility.UrlBank;

public class ProductHistoryAdapter extends BaseObjectListAdapter {

	public ProductHistoryAdapter(Context context, List<? extends Object> datas) {
		super(context, datas);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = View.inflate(mContext, R.layout.history_product_list,
					null);
		}
		// 商品图片
		ImageView uschool_news_user_img_IV = JackViewHolder.get(convertView,
				R.id.uschool_news_user_img_IV);
		// 商品title
		TextView uschool_news_username_TV = JackViewHolder.get(convertView,
				R.id.uschool_news_username_TV);
		// 订单状态
		TextView uschool_news_time_TV = JackViewHolder.get(convertView,
				R.id.uschool_news_time_TV);
		// 消费积分
		TextView uschool_news_content_TV = JackViewHolder.get(convertView,
				R.id.uschool_news_content_TV);
		ProductHistory pro = (ProductHistory) mDatas.get(position);
		uschool_news_username_TV.setText(pro.getTitle());
		uschool_news_time_TV.setText("审核中");
		uschool_news_content_TV.setText("消费:" + pro.getPoint() + "妹币");
		imageLoader.displayImage(UrlBank.getServerIp() + pro.getPicture(),
				uschool_news_user_img_IV, options);
		return convertView;
	}

}
